package C038;

/**
 * ClassName: C07
 * Package: C038
 * Description:
 *
 * @Author BCXJ
 * @Create 2025/1/30 19:47
 * @Version 1.0
 * @Since 1.0
 */
public class C07 {
    public static void main(String[] args) {
        process(3, "左", "中", "右");
    }


    public static void process(int cnts, String from, String other, String to) {
        if (cnts == 1) {
            System.out.println("圆盘" + cnts + " 从" + from + "移动到" + to);
            return;
        }

        process(cnts - 1, from, to, other);
        System.out.println("圆盘" + cnts + " 从" + from + "移动到" + to);
        process(cnts - 1, other, from, to);
    }
}
